<template>
  <div class="baseInfoRight">
    <h4 class="withVerticleLineT4 title14">{{ $t('basicInformation') }}</h4>
    <div class="baseInfoItems">
      <full-parent-dom-with-dask :loading="loadingData"></full-parent-dom-with-dask>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('partNumber') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="detailBaseInfoData.ecuModuleId || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('partName') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.name || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 供应商 -->
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('supplier') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="detailBaseInfoData.supplier ? detailBaseInfoData.supplier.fullName : '-'"
          >
          </table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('diagnosisID') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.ecuDiaId || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('softDid') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.ecuDid || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('softwareCoding') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="detailBaseInfoData.softwareCode || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{'子项目' }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.childItem || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('gdymk') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="hlvFlagObjText[detailBaseInfoData.hlvFlag]"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('isGydymk') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="hvPowerFlagObjText[detailBaseInfoData.hvPowerFlag]"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('sxStyle') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="ecuUpdateStyleObjText[detailBaseInfoData.ecuUpdateStyle]"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('sxType') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="ecuReprogramTypeObjText[detailBaseInfoData.ecuReprogramType]"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('sxWay') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="ecuReprogramWayObjText[detailBaseInfoData.ecuReprogramWay]"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('lingjian') }} IP</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.ecuIp || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('ljPort') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.ecuPort || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 是否有配置文件 -->
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :tableEllipsisIsTurnLine="false" :text="'是否有配置文件'"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="$t(detailBaseInfoData.hasConfig ? 'yes' : 'no') || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('configurationFile') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="detailBaseInfoData.ecuConfigDid || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('configurationFileCode') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="detailBaseInfoData.configSoftwareCode || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ '零部件编码' }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.partCode || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ '模块主芯片' }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.moduleMainChip || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ 'KeyK' }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.securityKey || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('encryption') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="ecuEncryptTypeObjText[detailBaseInfoData.encryptType] || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 是否验证Config.xml -->
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :text="$t('isVerifyConfigxml')"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :text="$t(detailBaseInfoData.checkConfig ? 'yes' : 'no') || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 是否有文件系统 -->
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :tableEllipsisIsTurnLine="false" :text="'是否有文件系统'"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="$t(detailBaseInfoData.hasFileSystem ? 'yes' : 'no') || '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 是否智驾ECU -->
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :tableEllipsisIsTurnLine="false" :text="'是否智驾ECU'"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.idrive==1 ? $t('yes') : detailBaseInfoData.idrive==0 ?$t('no') : '-' "
          ></table-ellipsis>
        </a-col>
      </a-row>
      <!-- 是否下发源版本包 -->
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :tableEllipsisIsTurnLine="false" :text="'是否下发源版本包'"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :tableEllipsisIsTurnLine="false"
            :text="detailBaseInfoData.needSourcePkg==1 ? $t('yes') : detailBaseInfoData.needSourcePkg==0 ?$t('no') : '-' "
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col
          :md="10"
          :sm="14"
        ><table-ellipsis :text="$t('ecuHardDid')"></table-ellipsis
        ></a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis
            :text="detailBaseInfoData.ecuHardDid ? detailBaseInfoData.ecuHardDid : '-'"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('OS') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.platform || '-'"></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('timeOfCreation') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis

            :text="$commonFun.getDateTimeStr(detailBaseInfoData.createTime)"
          ></table-ellipsis>
        </a-col>
      </a-row>
      <a-row class="baseInfoItem">
        <a-col :md="10" :sm="14">{{ $t('creator') }}</a-col>
        <a-col :md="14" :sm="10" class="result">
          <table-ellipsis :text="detailBaseInfoData.createBy || '-'"></table-ellipsis>
        </a-col>
      </a-row>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
import FullParentDomWithDask from '@/components/LoadDataSpin/FullParentDomWithDask.vue'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
export default {
  components: {
    FullParentDomWithDask,
    TableEllipsis
  },
  props: {
    detailBaseInfoData: {
      type: Object,
      default () {
        return {}
      }
    },
    loadingData: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    ...mapState({
      ecuParma: (state) => state.ecu
    }),
    ecuReprogramTypeObjText () {
      return this.$store.getters.getDictCodeObj('ecuReprogramTypeDictCode')
    },
    ecuReprogramWayObjText () {
      return this.$store.getters.getDictCodeObj('ecuReprogramWayDictCode')
    },
    hlvFlagObjText () {
      return this.$store.getters.getDictCodeObj('hlvFlagDictCode')
    },
    hvPowerFlagObjText () {
      return this.$store.getters.getDictCodeObj('hvPowerFlagDictCode')
    },
    ecuUpdateStyleObjText () {
      return this.$store.getters.getDictCodeObj('ecuUpdateStyleDictCode')
    },
    ecuEncryptTypeObjText () {
      return this.$store.getters.getDictCodeObj('ecuEncryptTypeDictCode')
    }
  },
  created () {},
  data () {
    return {}
  },
  mounted () {
    this.$store.dispatch('getEcuReprogramTypeDictCodeData')
    this.$store.dispatch('getEcuReprogramWayDictCodeData')
    this.$store.dispatch('getEcuUpdateStyleDictCodeData')
    this.$store.dispatch('getHvPowerFlagDictCodeData')
    this.$store.dispatch('getHlvFlagDictCodeData')
    this.$store.dispatch('getEcuEncryptTypeDictCodeData')
  },
  methods: {}
}
</script>
